# -*- coding: utf-8 -*-
# @Author : HaleShi
# @Time : 2023-06-28
# @File : 9_frida-rpc.py

import frida

rdev = frida.get_remote_device()
session = rdev.attach("大姨妈")

scr = """
rpc.exports = {   
    sign:function(j2,str,j3){
         var res;

         Java.perform(function () {
            
            // 包.类
            var Crypt = Java.use("com.yoloho.libcore.util.Crypt");
            
            // 类中的方法
            res = Crypt.encrypt_data(j2,str,j3);
         });

         return res;
    }
}
"""
script = session.create_script(scr)
script.load()

sign = script.exports.sign(0, "1c23fdb2860abc71560074db1d2b4b7673dc02e7user/login18378353331Pneqv/aCWUxlagDjPcT1oQ==", 85)
print(sign)
